#include <stdio.h>
#define k 8

int main() {
	int a[k][k], m, n;
	for (m = 0; m < k; m++) {
		for (n = 0; n < m + 1; n++) {
			if (n == 0)
				a[m][n] = 1;
			else if (n == m)
				a[m][n] = 1;
			else
				a[m][n] = a[m - 1][n] + a[m - 1][n - 1];
		}
	}
	for (m = 0; m < k; m++) {
		for (n = 0; n < m + 1; n++)
			printf("%d\t", a[m][n]);
		printf("\n");
	}
}